Network Icon

Ejemplos de guiones

Con Thinking Home se puede usar AppleScript con un diccionario completo. Se puede navegar con cualquier editor de guiones. Lo que no se ve en el diccionario es que usted puede referirse a los dispositivos de distintas formas. Prácticamente cualquier forma funcionará. Por ejemplo, los ejemplos que figuran a continuación para “encender” son todos equivalentes.

Estos son algunos ejemplos de AppleScript en Thinking Home.

Refiriéndose a un dispositivo

-- Puede trabajar con los dispositivos de la forma que prefiera.
tell application "Thinking Home"
turn on the "Luz del porche"
turn on "P16"
turn on device "Luz del porche"
turn on device 3
end tell

tell the "Luz del porche" of application "Thinking Home"
turn on
end tell

tell application "Thinking Home"
tell the "Luz del porche"
turn on
end tell
end tell

Para atenuar y aumentar la intensidad de la luz

-- Atenuar y aumentar la intensidad de la luz también es fácil.
tell application "Thinking Home"
dim the "Luz del porche"-- el valor por omisión es 35%
brighten the "Luz del porche" by 80 -- por ciento
dim the "Luz del porche" to 20 -- por ciento
end tell

Hora de la salida y la puesta del sol

tell application "Thinking Home"
set miPuestaDelSol to the sunrise for the current date
set miSalidaDelSol to the sunset for the current date
end tell